//
//  GroupActivity.m
//  SportSocial
//
//  Created by yull on 15/1/12.
//  Copyright (c) 2015年 yull. All rights reserved.
//

#import "GroupActivity.h"

@implementation GroupActivity

+ (instancetype)groupActivityWithDict:(NSDictionary *)dict
{
    GroupActivity *groupActivity = [[GroupActivity alloc] init];
    for (NSString *key in dict.allKeys) {
        id value = [dict objectForKey:key];
        if ([value isKindOfClass:[NSNull class]]) {
            value = @"";
        }
        
        [groupActivity setValue:value forKey:key];
    }
    return groupActivity;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    if ([key isEqualToString:@"id"]) {
        [self setValue:value forKey:@"activity_id"];
    }else {
        [super setValue:value forUndefinedKey:key];
    }
}
@end
